//
//  RPAlertController.h
//  RPAlertControllerDemo
//
//  Created by iOS on 21/11/22.
//  Copyright (c) 2021年 sword. All rights reserved.
//

#import <UIKit/UIKit.h>

// 弹出方式
typedef NS_ENUM(NSInteger, RPAlertControllerStyle) {
    RPAlertControllerStyleAlert = 0,     // 提示框
    RPAlertControllerStyleActionSheet,   // 底部弹出
    RPAlertControllerStyleSideSlipLeft,  // 左滑
    RPAlertControllerStyleSideSlipRight, // 右滑
};

// 动画
typedef NS_ENUM(NSInteger, RPAlertTransitionAnimation) {
    RPAlertTransitionAnimationNone = 0, // 无动画
    RPAlertTransitionAnimationNormal,   // 普通
    RPAlertTransitionAnimationSpring,   // 弹跳
    RPAlertTransitionAnimationDropDown, // 掉落
};

@protocol RPAlertDelegate <NSObject>

- (UIViewController *_Nullable)alertController;
@end

/**
 * 弹出视图控制器
 */
@interface RPAlertController : UIViewController <RPAlertDelegate>
// 初始化
+ (instancetype)alertControllerWithAlertView:(UIView *)alertView style:(RPAlertControllerStyle)style animation:(RPAlertTransitionAnimation)animation;
// 背景
@property (nonatomic, strong, readonly) UIView *backgroundView;
// 弹窗内容
@property (nonatomic, strong, readonly) UIView *alertView;
// 弹出样式,默认Alert
@property (nonatomic, assign) RPAlertControllerStyle preferredStyle;
// 动画样式,默认Normal
@property (nonatomic, assign) RPAlertTransitionAnimation transitionAnimation;
// 点击背景消失,默认NO
@property (nonatomic, assign) BOOL backgoundTapDismissEnable;
// 拖曳销毁手势,默认NO, 当弹出样式为Alert时,手势不起作用
@property (nonatomic, assign) BOOL draggingDismissEnable;
// Alert上下偏移,默认0
@property (nonatomic, assign) CGFloat alertViewCenterYOffset;
// Alert与屏幕左右最小距离,默认15
@property (nonatomic, assign) CGFloat alertStyleEdging;
// ActionSheet与屏幕左右距离,默认0
@property (nonatomic, assign) CGFloat actionSheetStyleEdging;
// 拖曳手势
@property (nonatomic, weak) UIPanGestureRecognizer *draggingPan;
/// 拖曳阈值
@property (nonatomic, assign) CGFloat draggingThreshold;
/// 是否缓动函数
@property(nonatomic, assign) BOOL useEasingfunction;
/// 视图消失Block
@property (nonatomic, copy) void(^dismissBlock)(void);
@end
